package com.kk.xhr.common;

/**
 * 错误码匿名类
 *
 * @author luokexiong
 * @version 1.0 2021/2/13
 * @since 1.0.0
 */
public enum ErrorCodeEnum {
    /** 成功 */
    OK(0, "成功"),
    UNKNOWN_ERROR(1, "未知错误"),
    BAD_REQUEST(2, "请求错误"),
    UNAUTHORIZED(3, "未认证"),
    FORBIDDEN(4, "拒绝访问"),
    METHOD_NOT_ALLOWED(5, "方法类型不正确"),
    RETRY(6, "请重试！"),
    TIMEOUT(7, "超时访问"),
    RATE_LIMITER_EXCEEDED(8, "限流执行"),
    SERVICE_RATE_LIMITER_EXCEEDED(9, "服务限流执行"),
    DELETE_FAILED(10, "delete_failed"),
    FILE_UPLOAD_FAIL(11, "文件上传失败"),
    FILE_READ_FAIL(12, "文件读取失败"),

    /** user 10000开始 */
    USER_NOT_EXIST(10000, "用户不存在"),
    REVIEWER_NOT_EQUAL(10001, "审核人不一致"),
    PASSWORD_ERROR(10002, "密码错误"),
    LOGIN_FAILED(10003, "登录失败"),
    ROLE_NOT_ALLOW_DELETE(10004, "该角色为系统角色，无法删除"),
    /** 档案相关 10100开始 */
    EMPLOYEE_NOT_EXIST(10100, "员工不存在"),
    /** 考勤相关 10200开始 */
    DATE_ERROR(10200, "日期错误"),
    COMPLEMENT_SIGN_NOT_EXIST(10201, "补签记录不存在"),
    REVIEWER_ERROR(10202, "审核人员错误"),
    SIGN_ERROR(10203, "签到时间错误"),
    UP_SIGN_NOT_EXIST(10204, "早签记录不存在"),
    APPLY_RECODE_NOT_EXIST(10205, "申请记录不存在"),
    /** 职位相关 10300开始 */
    POSITION_ALREADY_EXIST(10300, "职位已经存在"),
    POSITION_NOT_EXIST(10301, "职位不存在"),
    POSITION_DELETE_FAIL(10302, "职位删除失败，或存在使用对象"),
    LEVEL_DELETE_FAIL(10302, "等级删除失败，或存在使用对象"),
    /** 部门相关 10400开始 */
    DEPARTMENT_NOT_EXIST(10400, "部门不存在"),
    DEPARTMENT_DELETE_FAIL(10401, "请先转移该部门下的成员"),
    TRANSFER_NOT_EXIST(10402, "调岗信息不存在或已生效"),
    DEPARTMENT_CHANGE_FAIL(10402, "请先更改部门负责人"),
    /** 薪资相关 10500开始 */
    SALARY_NOT_EXIST(10500, "薪资记录不存在"),
    SALARY_ALREADY_EXIST(10501, "薪资记录已存在"),
    /** 公告与笔记相关 10600开始 */
    CONTENT_EMPTY(10600, "内容不能为空"),
    /** 招聘 10700开始 */
    CANDIDATE_NOT_EXIST(10700, "候选人不存在"),
    RECRUIT_NOT_EXIST(10701, "招聘计划不存在"),
    RECRUIT_ALREADY_ENOUGH(10702, "招聘计划已满足"),
    RECRUIT_ALREADY_END(10703, "招聘计划已截至"),
    RECRUIT_ALREADY_PASS(10704, "招聘计划已完成");

    private final int code;

    private final String message;

    ErrorCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
